import React, { Component } from 'react';
import TheTable from "@/components/TheTable";
import ThePagination from "@/components/ThePagination";
export default class EventTracking extends Component {
    constructor() {
        super()
        this.state = {
            columns1: [
                {
                    title: "活动名称",
                    key: "activityName",
                    key: "activityName",
                },
                {
                    title: "活动页面访问数",
                    dataIndex: "activityId",
                    key: "activityId",
                },
                {
                    title: "活动页面访问人数",
                    key: "activityStatus",
                    dataIndex: 'activityStatus'
                },
                {
                    title: "活动商品购买数",
                    key: "activityStatus",
                    dataIndex: 'activityStatus'
                },
                {
                    title: "加购数",
                    key: "activityStatus",
                    dataIndex: 'activityStatus'
                },

            ],
            columns2: [
                {
                    title: "标题",
                    key: "activityName",
                    key: "activityName",
                },
                {
                    title: "位置",
                    dataIndex: "activityId",
                    key: "activityId",
                },
                {
                    title: "点击数",
                    key: "activityStatus",
                    dataIndex: 'activityStatus'
                },
                {
                    title: "点击人数",
                    key: "activityStatus",
                    dataIndex: 'activityStatus'
                },
            ],
            dataSource1: [],
            dataSource2: [],
            pageData1: {
                pageNo: 1,
                pageSize: 10,
            },
            pageData2: {
                pageNo: 1,
                pageSize: 10,
            },
            total1: 0,
            total2: 0,

        }
    }
    componentDidMount() {
    }
    pageChange1 = (pageNo, pageSize) => {
        this.setState({
            pageData1: {
                pageNo,
                pageSize
            }
        })
    }
    pageChange2 = (pageNo, pageSize) => {
        this.setState({
            pageData2: {
                pageNo,
                pageSize
            }
        })
    }
    render() {
        const { columns1, dataSource1, columns2, dataSource2, pageData1, pageData2, total1, total2 } = this.state

        return (
            <div className="p-layout-box">
                {/* <SearchHeader setValue={this.setValue} goAdd={this.goAdd} onUpload={this.onUpload} /> */}
                <div className="p-layout-content-pagination">
                    <TheTable
                        scroll={{ x: "max-content", y: '63vh' }}
                        columns={columns1}
                        dataSource={dataSource1}
                        pageData={pageData1}
                    />
                    <ThePagination pageNo={pageData1.pageNo} pageSize={pageData1.pageSize} total={total1} pageChange={this.pageChange} />
                </div>
                <div className="p-layout-content-pagination">
                    <TheTable
                        scroll={{ x: "max-content", y: '63vh' }}
                        columns={columns2}
                        dataSource={dataSource2}
                        pageData={pageData2}
                    />
                    <ThePagination pageNo={pageData2.pageNo} pageSize={pageData2.pageSize} total={total2} pageChange={this.pageChange2} />
                </div>
            </div>
        );
    }
}
